package com.doubao.file.feign;

import com.doubao.common.result.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * 用户服务Feign客户端
 */
@FeignClient(name = "doubao-user", path = "/user")
public interface UserFeignClient {

    /**
     * 更新用户头像
     */
    @PutMapping("/avatar")
    Result<Void> updateUserAvatar(@RequestParam("userId") Long userId,
                                  @RequestParam("avatarUrl") String avatarUrl);

    /**
     * 获取用户信息
     */
    @GetMapping("/{userId}")
    Result<Object> getUserInfo(@PathVariable("userId") Long userId);

    /**
     * 校验用户是否存在
     */
    @GetMapping("/exists/{userId}")
    Result<Boolean> checkUserExists(@PathVariable("userId") Long userId);

    /**
     * 获取用户当前头像
     */
    @GetMapping("/avatar/{userId}")
    Result<String> getUserAvatar(@PathVariable("userId") Long userId);
}